package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.UserAuthPageDto;
import com.heima.user.service.UserAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author atom.hu
 * @version V1.0
 * @Package com.heima.user.controller.v1
 * @date 2021/12/22 16:30
 */
@RestController
@RequestMapping("/api/v1/auth")
public class UserAuthController {
    @Autowired
    private UserAuthService userAuthService;

    @PostMapping("/list")
    public ResponseResult list(@RequestBody UserAuthPageDto dto){
        ResponseResult responseResult = userAuthService.listAll(dto);
        return responseResult;
    }

    @PostMapping("/authFail")
    public  ResponseResult authFail(@RequestBody UserAuthPageDto dto){
        return userAuthService.authFail(dto);
    }

    @PostMapping("/authPass")
    public  ResponseResult authPass(@RequestBody UserAuthPageDto dto){

        return userAuthService.authPass(dto);
    }
}
